/*
 * ISearchModel.java
 * business
 *
 * Created by ChenTao on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.model;

import com.yidiandao.business.data.bean.Goods;
import com.yidiandao.business.data.bean.Tag;
import com.yidiandao.business.data.recyclertype.DoubleGoods;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;

import java.util.List;

/** 搜索 */
public interface ISearchModel {
    /** 热门商品/店铺 */
    void getGoodsHot(String pagerTag, int type, onLoadNetListener listener);

    /** 商品最新搜索 */
    void loadNewGoodsList(
            boolean isRefreshing,
            String pagerTag,
            String keyword,
            int type,
            OnLoadSearchGoodsListener listener);

    void loadPriceGoodsList(
            boolean isRefreshing,
            String pagerTag,
            boolean isSortUP,
            String keyword,
            int type,
            OnLoadSearchGoodsListener listener);

    void loadSalesGoodsList(
            boolean isRefreshing,
            String pagerTag,
            String keyword,
            int type,
            OnLoadSearchGoodsListener listener);

    /** 店铺搜索 */
    void searchShop(
            String pagerTag, String keyword, int page, int type, onSearchShopsListener listener);

    interface onLoadNetListener {
        void onSuccess(List<Tag> tags);

        void onFailed();

        void onFinal();
    }

    interface onSearchGoodsListener {
        void onSuccess(int totalPage, List<DoubleGoods> goodsList);

        void onFailed();

        void onFinal();
    }

    interface onSearchShopsListener {

        void onSuccess(int totalPage, List<DisplayListItem> displayListItems);

        void onFailed();

        void onFinal();
    }

    interface OnLoadSearchGoodsListener {

        void onSuccess(
                List<Goods> singleGoodsList,
                List<DoubleGoods> doubleGoodsList,
                boolean emptyResult,
                boolean hasMoreData);

        void onFailed();

        void onFinal();
    }
}
